home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
56194
/
56194.xpi
/
install.js
< prev
next >
Wrap
Text File
|
2010-01-13
|
2KB
|
66 lines
var linkextendXpiInstaller = {
extFullName: "TopSite",
extShortName: "topsite",
extVersion: "1.0.4",
extAuthor: "SimilarGroup",
extLocaleNames: ['en-US'],
extPostInstallMessage: null,
profileInstall: true,
silentInstall: false,
install: function() {
if (Install.arguments && (Install.arguments == "p=0" || Install.arguments == "p=1")) {
this.profileInstall = (Install.arguments == "p=1");
this.silentInstall = true;
}
var jarName = this.extShortName + ".jar";
var profileDir = Install.getFolder("Profile", "chrome");
if (File.exists(Install.getFolder(profileDir, jarName))) {
if (!this.silentInstall)
Install.alert("Updating existing Profile install of " + this.extFullName + " to version " + this.extVersion + ".");
this.profileInstall = true;
} else if (!this.silentInstall) {
this.profileInstall = Install.confirm("Install " + this.extFullName + " " + this.extVersion + " to your Profile directory (OK) or your Browser directory (Cancel)?");
}
Install.initInstall(this.extFullName, this.extShortName, this.extVersion);
var installPath = (this.profileInstall)?profileDir:Install.getFolder("chrome");
Install.addFile(null, "chrome/" + jarName, installPath, null);
var jarPath = Install.getFolder(installPath, jarName);
var installType = (this.profileInstall)?Install.PROFILE_CHROME:Install.DELAYED_CHROME;
Install.registerChrome(Install.CONTENT | installType, jarPath, "content/");
for (var locale in this.extLocaleNames) {
var regPath = "locale/" + this.extLocaleNames[locale] + "/" + this.extShortName + "/";
Install.registerChrome(Install.LOCALE | installType, jarPath, regPath);
}
Install.registerChrome(Install.SKIN | installType, jarPath, "skin/");
if (!this.profileInstall) {
installPath = Install.getFolder("Components");
for (var comp in this.extComponents) {
Install.addFile(null, "components/" + this.extComponents[comp], installPath, null);
}
}
var err = Install.performInstall();
if (err == Install.SUCCESS || err == Install.REBOOT_NEEDED) {
if (!this.silentInstall && this.extPostInstallMessage)
Install.alert(this.extPostInstallMessage);
} else {
if (!this.silentInstall)
Install.alert("Error: Could not install " + this.extFullName + " " + this.extVersion + " (Error code: " + err + ")");
Install.cancelInstall(err);
}
}
};
linkextendXpiInstaller.install();